<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript">
  $(function() {

    parent.$.messager.progress('close');
    $('#form').form({
      url : '${pageContext.request.contextPath}/admin/role/edit',
      onSubmit : function() {
        parent.$.messager.progress({
          title : '提示',
          text : '数据处理中，请稍后....'
        });
        var isValid = $(this).form('validate');
        if (!isValid) {
          parent.$.messager.progress('close');
        }
        return isValid;
      },
      success : function(result) {
        parent.$.messager.progress('close');
        result = $.parseJSON(result);
        if (result.success) {
          parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
          parent.$.modalDialog.handler.dialog('close');
          parent.$.messager.show({
            title : '成功',
            msg : '角色修改成功！'
          });
        } else {
          parent.$.messager.alert('错误', result.msg, 'error');
        }
      }
    });
  });
</script>
<div class="easyui-layout" data-options="fit:true,border:false">
  <div data-options="region:'center',border:false" title="" style="overflow: hidden;">
    <form id="form" method="post">
      <table class="table table-hover table-condensed">
        <tr>
          <th>编号</th>
          <td><input name="id" type="text" class="span2" value="${role.id}" readonly="readonly"></td>
          <th>角色名称</th>
          <td><input name="roleName" type="text" placeholder="请输入角色名称"
            class="easyui-validatebox span2" data-options="required:true" value="${role.roleName}"></td>
        </tr>
        <tr>
          <th>排序</th>
          <td><input name="roleSort" value="${role.roleSort}" class="easyui-numberspinner"
            style="width: 140px; height: 29px;" required="required" data-options="editable:false"></td>
        </tr>
        <tr>
          <th>备注</th>
          <td colspan="3"><textarea name="roleDesc" rows="" cols="" class="span5">${role.roleDesc}</textarea></td>
        </tr>
      </table>
    </form>
  </div>
</div>